// 疾病库
import  request  from "@/utils/axios";
import appName from "../appName"
const timeout = 900000;

// 获取疾病树
export function getTreeApi(params) {
  return request({
    url: appName.AUSCONFING + '/diseaseTree/getTree',
    method: 'get',
    data: params,
    timeout:timeout
  })
}

// 获取父级疾病树
export function getTreeParentApi(params) {
  return request({
    url: appName.AUSCONFING + '/diseaseTree/getTreeParent',
    method: 'get',
    data: params,
    timeout:timeout
  })
}

// 获取子级疾病树
export function getTreeNodeApi(params) {
  return request({
    url: appName.AUSCONFING + `/diseaseTree/getTreeNode?code=${params.code}`,
    method: 'POST',
    timeout:timeout
  })
}

// 新增疾病分类
export function categoryInsertOrUpdateApi(params) {
  return request({
    url: appName.AUSCONFING + '/diseaseTree/category/insertOrUpdate',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 新增疾病
export function diseaseInsertOrUpdateApi(params) {
  return request({
    url: appName.AUSCONFING + '/diseaseTree/disease/insertOrUpdate',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除疾病分类
export function categoryRemoveByIdApi(params) {
  return request({
    url: appName.AUSCONFING + '/diseaseTree/category/removeById',
    method: 'post',
    data: params,
    timeout:timeout
  })
}

// 删除疾病
export function diseaseRemoveByIdApi(params) {
  return request({
    url: appName.AUSCONFING + '/diseaseTree/disease/removeById?diseaseId=' + params,
    method: 'post',
    timeout:timeout
  })
}